import axios from "axios";

export default function ({ begTime, endTime }) {
  return new Promise((resolve, reject) => {
    axios
      .get(
        `api/flow_ntfm_get.php?begTime=${begTime}&endTime=${endTime}&tag=1&history=1`
      )
      .then((responseTMA) => {
        // console.log("queryDataTMA", response.data);
        axios
        .get(
          `api/flow_ntfm_get_airports.php?begTime=${begTime}&endTime=${endTime}&tag=1&his=1`
        )
        .then((responseAP) => {
          // console.log("queryDataAP", response.data);
          resolve({
            replyTMA:responseTMA.data,
            replyAP:responseAP.data,
          });
        })
        .catch((error) => {
          reject(error);
          console.error(error);
        });
      })
      .catch((error) => {
        reject(error);
        console.error(error);
      });
  });
}
